Browse Source

Use autocolourisation

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
83e1340d88
1 changed files with 13 additions and 10 deletions
  1. 13
    10
      src/net/tcp/ftp.c

+ 13
- 10
src/net/tcp/ftp.c View File

75
  */
75
  */
76
 static void ftp_done ( struct ftp_request *ftp, int rc ) {
76
 static void ftp_done ( struct ftp_request *ftp, int rc ) {
77
 
77
 
78
-	DBG ( "FTP %p completed with status %d\n", ftp, rc );
78
+	DBGC ( ftp, "FTP %p completed with status %d\n", ftp, rc );
79
 
79
 
80
 	/* Close both TCP connections */
80
 	/* Close both TCP connections */
81
 	tcp_close ( &ftp->tcp );
81
 	tcp_close ( &ftp->tcp );
118
 static void ftp_reply ( struct ftp_request *ftp ) {
118
 static void ftp_reply ( struct ftp_request *ftp ) {
119
 	char status_major = ftp->status_text[0];
119
 	char status_major = ftp->status_text[0];
120
 
120
 
121
-	DBG ( "FTP %p received status %s\n", ftp, ftp->status_text );
121
+	DBGC ( ftp, "FTP %p received status %s\n", ftp, ftp->status_text );
122
 
122
 
123
 	/* Ignore "intermediate" responses (1xx codes) */
123
 	/* Ignore "intermediate" responses (1xx codes) */
124
 	if ( status_major == '1' )
124
 	if ( status_major == '1' )
149
 		ftp_parse_value ( &ptr, ( uint8_t * ) &sa.sin.sin_port,
149
 		ftp_parse_value ( &ptr, ( uint8_t * ) &sa.sin.sin_port,
150
 				  sizeof ( sa.sin.sin_port ) );
150
 				  sizeof ( sa.sin.sin_port ) );
151
 		if ( ( rc = tcp_connect ( &ftp->tcp_data, &sa.st, 0 ) ) != 0 ){
151
 		if ( ( rc = tcp_connect ( &ftp->tcp_data, &sa.st, 0 ) ) != 0 ){
152
-			DBG ( "FTP %p could not create data connection\n",
153
-			      ftp );
152
+			DBGC ( ftp, "FTP %p could not make data connection\n",
153
+			       ftp );
154
 			ftp_done ( ftp, rc );
154
 			ftp_done ( ftp, rc );
155
 			return;
155
 			return;
156
 		}
156
 		}
162
 	ftp->already_sent = 0;
162
 	ftp->already_sent = 0;
163
 
163
 
164
 	if ( ftp->state < FTP_DONE ) {
164
 	if ( ftp->state < FTP_DONE ) {
165
-		DBG ( "FTP %p sending ", ftp );
166
-		DBG ( ftp_strings[ftp->state].format, ftp_string_data ( ftp,
167
-				       ftp_strings[ftp->state].data_offset ) );
165
+		const struct ftp_string *string = &ftp_strings[ftp->state];
166
+		DBGC ( ftp, "FTP %p sending ", ftp );
167
+		DBGC ( ftp, string->format,
168
+		       ftp_string_data ( ftp, string->data_offset ) );
168
 	}
169
 	}
169
 
170
 
170
 	return;
171
 	return;
270
 static void ftp_closed ( struct tcp_application *app, int status ) {
271
 static void ftp_closed ( struct tcp_application *app, int status ) {
271
 	struct ftp_request *ftp = tcp_to_ftp ( app );
272
 	struct ftp_request *ftp = tcp_to_ftp ( app );
272
 
273
 
273
-	DBG ( "FTP %p control connection closed (status %d)\n", ftp, status );
274
+	DBGC ( ftp, "FTP %p control connection closed (status %d)\n",
275
+	       ftp, status );
274
 
276
 
275
 	/* Complete FTP operation */
277
 	/* Complete FTP operation */
276
 	ftp_done ( ftp, status );
278
 	ftp_done ( ftp, status );
315
 static void ftp_data_closed ( struct tcp_application *app, int status ) {
317
 static void ftp_data_closed ( struct tcp_application *app, int status ) {
316
 	struct ftp_request *ftp = tcp_to_ftp_data ( app );
318
 	struct ftp_request *ftp = tcp_to_ftp_data ( app );
317
 
319
 
318
-	DBG ( "FTP %p data connection closed (status %d)\n", ftp, status );
320
+	DBGC ( ftp, "FTP %p data connection closed (status %d)\n",
321
+	       ftp, status );
319
 	
322
 	
320
 	/* If there was an error, close control channel and record status */
323
 	/* If there was an error, close control channel and record status */
321
 	if ( status )
324
 	if ( status )
358
 struct async_operation * ftp_get ( struct ftp_request *ftp ) {
361
 struct async_operation * ftp_get ( struct ftp_request *ftp ) {
359
 	int rc;
362
 	int rc;
360
 
363
 
361
-	DBG ( "FTP %p fetching %s\n", ftp, ftp->filename );
364
+	DBGC ( ftp, "FTP %p fetching %s\n", ftp, ftp->filename );
362
 
365
 
363
 	ftp->tcp.tcp_op = &ftp_tcp_operations;
366
 	ftp->tcp.tcp_op = &ftp_tcp_operations;
364
 	ftp->tcp_data.tcp_op = &ftp_data_tcp_operations;
367
 	ftp->tcp_data.tcp_op = &ftp_data_tcp_operations;

Loading…
Cancel
Save