Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 64632 | Differences between
and this patch

Collapse All | Expand All

(-)netkit-telnet-0.17/telnetd/ext.h.sa-01-49 (-1 / +7 lines)
Lines 86-92 Link Here
86
extern int pcc, ncc;
86
extern int pcc, ncc;
87
87
88
/* printf into netobuf */
88
/* printf into netobuf */
89
void netoprintf(const char *fmt, ...) __attribute((format (printf, 1, 2))); 
89
/* void netoprintf(const char *fmt, ...) __attribute((format (printf, 1, 2))); */
90
#define netoprintf output_data
91
int	output_data(const char *, ...) __attribute((format (printf, 1, 2))); 
92
void	output_datalen(const char *, int);
90
93
91
extern int pty, net;
94
extern int pty, net;
92
extern char *line;
95
extern char *line;
Lines 182-188 Link Here
182
void tty_tspeed(int);
185
void tty_tspeed(int);
183
void willoption(int);
186
void willoption(int);
184
void wontoption(int);
187
void wontoption(int);
188
189
#if 0
185
void writenet(unsigned char *, int);
190
void writenet(unsigned char *, int);
191
#endif
186
192
187
#if defined(ENCRYPT)
193
#if defined(ENCRYPT)
188
extern void (*encrypt_output)(unsigned char *, int);
194
extern void (*encrypt_output)(unsigned char *, int);
(-)netkit-telnet-0.17/telnetd/slc.c.sa-01-49 (-1 / +1 lines)
Lines 183-189 Link Here
183
	else {
183
	else {
184
	    snprintf(slcbuf+slcoff, sizeof(slcbuf)-slcoff, "%c%c", IAC, SE);
184
	    snprintf(slcbuf+slcoff, sizeof(slcbuf)-slcoff, "%c%c", IAC, SE);
185
	    slcoff += 2;
185
	    slcoff += 2;
186
	    writenet(slcbuf, slcoff);
186
	    output_datalen(slcbuf, slcoff);
187
	    netflush();  /* force it out immediately */
187
	    netflush();  /* force it out immediately */
188
	}
188
	}
189
    }
189
    }
(-)netkit-telnet-0.17/telnetd/state.c.sa-01-49 (-1 / +2 lines)
Lines 37-42 Link Here
37
char state_rcsid[] = 
37
char state_rcsid[] = 
38
  "$Id: state.c,v 1.12 1999/12/12 19:41:44 dholland Exp $";
38
  "$Id: state.c,v 1.12 1999/12/12 19:41:44 dholland Exp $";
39
39
40
#include <stdarg.h>
40
#include "telnetd.h"
41
#include "telnetd.h"
41
42
42
int not42 = 1;
43
int not42 = 1;
Lines 1365-1371 Link Here
1365
    ADD(IAC);
1366
    ADD(IAC);
1366
    ADD(SE);
1367
    ADD(SE);
1367
1368
1368
    writenet(statusbuf, ncp - statusbuf);
1369
    output_datalen(statusbuf, ncp - statusbuf);
1369
    netflush();	/* Send it on its way */
1370
    netflush();	/* Send it on its way */
1370
1371
1371
    DIAG(TD_OPTIONS, {printsub('>', statusbuf, ncp - statusbuf); netflush();});
1372
    DIAG(TD_OPTIONS, {printsub('>', statusbuf, ncp - statusbuf); netflush();});
(-)netkit-telnet-0.17/telnetd/termstat.c.sa-01-49 (-1 lines)
Lines 128-134 Link Here
128
	void
128
	void
129
localstat()
129
localstat()
130
{
130
{
131
	void netflush();
132
	int need_will_echo = 0;
131
	int need_will_echo = 0;
133
132
134
	/*
133
	/*
(-)netkit-telnet-0.17/telnetd/utility.c.sa-01-49 (-9 / +66 lines)
Lines 38-45 Link Here
38
  "$Id: utility.c,v 1.11 1999/12/12 14:59:45 dholland Exp $";
38
  "$Id: utility.c,v 1.11 1999/12/12 14:59:45 dholland Exp $";
39
39
40
#define PRINTOPTIONS
40
#define PRINTOPTIONS
41
41
#define _GNU_SOURCE
42
#include <stdarg.h>
42
#include <stdarg.h>
43
#include <stdio.h>   
43
#include <sys/utsname.h>
44
#include <sys/utsname.h>
44
45
45
#ifdef AUTHENTICATE
46
#ifdef AUTHENTICATE
Lines 52-57 Link Here
52
 * utility functions performing io related tasks
53
 * utility functions performing io related tasks
53
 */
54
 */
54
55
56
/*
57
 * This function appends data to nfrontp and advances nfrontp.
58
 * Returns the number of characters written altogether (the
59
 * buffer may have been flushed in the process).
60
 */
61
62
int
63
output_data(const char *format, ...)
64
{
65
	va_list args;
66
	int len;
67
	char *buf;
68
69
	va_start(args, format);
70
	if ((len = vasprintf(&buf, format, args)) == -1)
71
		return -1;
72
	output_datalen(buf, len);
73
	va_end(args);
74
	free(buf);
75
	return (len);
76
}
77
78
void
79
output_datalen(const char *buf, int len)
80
{
81
	int remaining, copied;
82
	
83
	remaining = BUFSIZ - (nfrontp - netobuf);
84
	while (len > 0) {
85
		/* Free up enough space if the room is too low*/
86
		if ((len > BUFSIZ ? BUFSIZ : len) > remaining) {
87
			netflush();
88
			remaining = BUFSIZ - (nfrontp - netobuf);
89
		}
90
91
		/* Copy out as much as will fit */
92
		copied = remaining > len ? len : remaining;
93
		memmove(nfrontp, buf, copied);
94
		nfrontp += copied;
95
		len -= copied;
96
		remaining -= copied;
97
		buf += copied;
98
	}
99
	return;
100
}
101
102
/**
55
void
103
void
56
netoprintf(const char *fmt, ...)
104
netoprintf(const char *fmt, ...)
57
{
105
{
Lines 67-73 Link Here
67
      va_end(ap);
115
      va_end(ap);
68
116
69
      if (len<0 || len==maxsize) {
117
      if (len<0 || len==maxsize) {
70
	 /* didn't fit */
118
		/ * did not fit * /
71
	 netflush();
119
	 netflush();
72
      }
120
      }
73
      else {
121
      else {
Lines 76-81 Link Here
76
   }
124
   }
77
   nfrontp += len;
125
   nfrontp += len;
78
}
126
}
127
*/
79
128
80
/*
129
/*
81
 * ttloop
130
 * ttloop
Lines 273-282 Link Here
273
    int n;
322
    int n;
274
323
275
    if ((n = nfrontp - nbackp) > 0) {
324
    if ((n = nfrontp - nbackp) > 0) {
325
326
#if 0
327
	/* XXX This causes output_data() to recurse and die */
276
	DIAG(TD_REPORT,
328
	DIAG(TD_REPORT,
277
	    { netoprintf("td: netflush %d chars\r\n", n);
329
	    { netoprintf("td: netflush %d chars\r\n", n);
278
	      n = nfrontp - nbackp;  /* update count */
330
	      n = nfrontp - nbackp;  /* update count */
279
	    });
331
	    });
332
#endif
333
280
#if	defined(ENCRYPT)
334
#if	defined(ENCRYPT)
281
	if (encrypt_output) {
335
	if (encrypt_output) {
282
		char *s = nclearto ? nclearto : nbackp;
336
		char *s = nclearto ? nclearto : nbackp;
Lines 310-320 Link Here
310
	    }
364
	    }
311
	}
365
	}
312
    }
366
    }
313
    if (n < 0) {
367
314
	if (errno == EWOULDBLOCK || errno == EINTR)
368
	 if (n == -1) {
315
		return;
369
		if (errno == EWOULDBLOCK || errno == EINTR)
316
	cleanup(0);
370
		  return;
317
    }
371
		cleanup(0);
372
		/* NOTREACHED */
373
	 }
374
318
    nbackp += n;
375
    nbackp += n;
319
#if	defined(ENCRYPT)
376
#if	defined(ENCRYPT)
320
    if (nbackp > nclearto)
377
    if (nbackp > nclearto)
Lines 332-338 Link Here
332
    return;
389
    return;
333
}  /* end of netflush */
390
}  /* end of netflush */
334
391
335
392
#if 0
336
/*
393
/*
337
 * writenet
394
 * writenet
338
 *
395
 *
Lines 355-361 Link Here
355
	nfrontp += len;
412
	nfrontp += len;
356
413
357
}  /* end of writenet */
414
}  /* end of writenet */
358
415
#endif
359
416
360
/*
417
/*
361
 * miscellaneous functions doing a variety of little jobs follow ...
418
 * miscellaneous functions doing a variety of little jobs follow ...

Return to bug 64632