Mercurial > gftp.yaz
comparison lib/rfc959.c @ 60:8a9324fb63a4
2002-11-21 Brian Masney <masneyb@gftp.org>
* lib/protocols.c (gftp_get_next_line) - fixed several bugs
* lib/cache.c - Don't do a cache lookup in gftp_new_cache_entry(). In
gftp_find_cache_entry(), don't log an error to the user if we can't
open up the cache file
* lib/rfc959.c lib/rfc2068.c lib/protocols.c - small cache fixes
* lib/cache.c lib/rfc2068.c lib/rfc959.c - pass full buffer size
instead of buffer size - 1 to gftp_get_line
author | masneyb |
---|---|
date | Fri, 22 Nov 2002 00:54:38 +0000 |
parents | c01d91c10f6c |
children | 41b71c4e5076 |
comparison
equal
deleted
inserted
replaced
59:618423504fe0 | 60:8a9324fb63a4 |
---|---|
48 parms = request->protocol_data; | 48 parms = request->protocol_data; |
49 | 49 |
50 do | 50 do |
51 { | 51 { |
52 if ((num_read = gftp_get_line (request, &parms->sockfd_rbuf, tempstr, | 52 if ((num_read = gftp_get_line (request, &parms->sockfd_rbuf, tempstr, |
53 sizeof (tempstr) - 1, | 53 sizeof (tempstr), request->sockfd)) <= 0) |
54 request->sockfd)) <= 0) | |
55 break; | 54 break; |
56 | 55 |
57 if (isdigit ((int) *tempstr) && isdigit ((int) *(tempstr + 1)) | 56 if (isdigit ((int) *tempstr) && isdigit ((int) *(tempstr + 1)) |
58 && isdigit ((int) *(tempstr + 2))) | 57 && isdigit ((int) *(tempstr + 2))) |
59 { | 58 { |
893 parms = request->protocol_data; | 892 parms = request->protocol_data; |
894 | 893 |
895 do | 894 do |
896 { | 895 { |
897 if ((len = gftp_get_line (request, &parms->datafd_rbuf, | 896 if ((len = gftp_get_line (request, &parms->datafd_rbuf, |
898 tempstr, sizeof (tempstr) - 1, fd)) <= 0) | 897 tempstr, sizeof (tempstr), fd)) <= 0) |
899 { | 898 { |
900 gftp_file_destroy (fle); | 899 gftp_file_destroy (fle); |
901 return ((int) len); | 900 return ((int) len); |
902 } | 901 } |
903 | 902 |
917 while (1); | 916 while (1); |
918 | 917 |
919 len = strlen (tempstr); | 918 len = strlen (tempstr); |
920 if (!request->cached) | 919 if (!request->cached) |
921 { | 920 { |
922 request->last_dir_entry = g_malloc (len + 1); | 921 request->last_dir_entry = g_strdup_printf ("%s\n", tempstr); |
923 strcpy (request->last_dir_entry, tempstr); | 922 request->last_dir_entry_len = len + 1; |
924 request->last_dir_entry_len = len; | |
925 } | 923 } |
926 return (len); | 924 return (len); |
927 } | 925 } |
928 | 926 |
929 | 927 |