diff options
author | Rob Landley <rob@landley.net> | 2006-07-16 08:14:35 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-07-16 08:14:35 +0000 |
commit | 534374755d618c9c36c9940c82756241c4b25a67 (patch) | |
tree | fac906b4fa40a68c53cecf20215a7a25b3b1cab6 /networking/httpd.c | |
parent | afb94ecf2bb6c53ce2a381d6ce45a426243c76d9 (diff) | |
download | busybox-w32-534374755d618c9c36c9940c82756241c4b25a67.tar.gz busybox-w32-534374755d618c9c36c9940c82756241c4b25a67.tar.bz2 busybox-w32-534374755d618c9c36c9940c82756241c4b25a67.zip |
Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 4cd09448c..452b56d19 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -961,7 +961,7 @@ static int sendHeaders(HttpResponseNum responseNum) | |||
961 | #if DEBUG | 961 | #if DEBUG |
962 | fprintf(stderr, "Headers: '%s'", buf); | 962 | fprintf(stderr, "Headers: '%s'", buf); |
963 | #endif | 963 | #endif |
964 | return bb_full_write(a_c_w, buf, len); | 964 | return full_write(a_c_w, buf, len); |
965 | } | 965 | } |
966 | 966 | ||
967 | /**************************************************************************** | 967 | /**************************************************************************** |
@@ -1222,7 +1222,7 @@ static int sendCgi(const char *url, | |||
1222 | break; | 1222 | break; |
1223 | } | 1223 | } |
1224 | } else if(post_readed_size > 0 && FD_ISSET(outFd, &writeSet)) { | 1224 | } else if(post_readed_size > 0 && FD_ISSET(outFd, &writeSet)) { |
1225 | count = bb_full_write(outFd, wbuf + post_readed_idx, post_readed_size); | 1225 | count = full_write(outFd, wbuf + post_readed_idx, post_readed_size); |
1226 | if(count > 0) { | 1226 | if(count > 0) { |
1227 | post_readed_size -= count; | 1227 | post_readed_size -= count; |
1228 | post_readed_idx += count; | 1228 | post_readed_idx += count; |
@@ -1263,14 +1263,14 @@ static int sendCgi(const char *url, | |||
1263 | rbuf[count] = 0; | 1263 | rbuf[count] = 0; |
1264 | /* check to see if the user script added headers */ | 1264 | /* check to see if the user script added headers */ |
1265 | if(strncmp(rbuf, "HTTP/1.0 200 OK\r\n", 4) != 0) { | 1265 | if(strncmp(rbuf, "HTTP/1.0 200 OK\r\n", 4) != 0) { |
1266 | bb_full_write(s, "HTTP/1.0 200 OK\r\n", 17); | 1266 | full_write(s, "HTTP/1.0 200 OK\r\n", 17); |
1267 | } | 1267 | } |
1268 | if (strstr(rbuf, "ontent-") == 0) { | 1268 | if (strstr(rbuf, "ontent-") == 0) { |
1269 | bb_full_write(s, "Content-type: text/plain\r\n\r\n", 28); | 1269 | full_write(s, "Content-type: text/plain\r\n\r\n", 28); |
1270 | } | 1270 | } |
1271 | firstLine = 0; | 1271 | firstLine = 0; |
1272 | } | 1272 | } |
1273 | if (bb_full_write(s, rbuf, count) != count) | 1273 | if (full_write(s, rbuf, count) != count) |
1274 | break; | 1274 | break; |
1275 | 1275 | ||
1276 | #if DEBUG | 1276 | #if DEBUG |
@@ -1337,8 +1337,8 @@ static int sendFile(const char *url) | |||
1337 | char *buf = config->buf; | 1337 | char *buf = config->buf; |
1338 | 1338 | ||
1339 | sendHeaders(HTTP_OK); | 1339 | sendHeaders(HTTP_OK); |
1340 | while ((count = bb_full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { | 1340 | while ((count = full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { |
1341 | if (bb_full_write(a_c_w, buf, count) != count) | 1341 | if (full_write(a_c_w, buf, count) != count) |
1342 | break; | 1342 | break; |
1343 | } | 1343 | } |
1344 | close(f); | 1344 | close(f); |
@@ -2000,7 +2000,7 @@ int httpd_main(int argc, char *argv[]) | |||
2000 | # ifdef CONFIG_FEATURE_HTTPD_SETUID | 2000 | # ifdef CONFIG_FEATURE_HTTPD_SETUID |
2001 | /* drop privileges */ | 2001 | /* drop privileges */ |
2002 | if(uid > 0) | 2002 | if(uid > 0) |
2003 | setuid(uid); | 2003 | xsetuid(uid); |
2004 | # endif | 2004 | # endif |
2005 | #endif | 2005 | #endif |
2006 | 2006 | ||