@@ -30,15 +30,15 @@ extern int epfd;
3030static state_action http_stats_after_eol (scache_connection* connection) {
3131 connection->state = 0 ;
3232 CONNECTION_HANDLER (connection, http_cache_handle_eolstats);
33- return needs_more ;
33+ return needs_more_read ;
3434}
3535
3636static state_action http_write_response_after_eol (scache_connection* connection, int http_template) {
3737 CONNECTION_HANDLER (connection, http_handle_eolwritetoend);
3838 connection->output_buffer = http_templates[http_template];
3939 connection->output_length = http_templates_length[http_template];
4040 connection->state = 1 ;
41- return needs_more ;
41+ return needs_more_read ;
4242}
4343
4444static state_action http_write_response (scache_connection* connection, int http_template) {
@@ -55,7 +55,7 @@ static state_action http_headers_response_after_eol(scache_connection* connectio
5555 connection->output_buffer = http_templates[http_template];
5656 connection->output_length = http_templates_length[http_template];
5757 connection->state = 2 ;
58- return needs_more ;
58+ return needs_more_read ;
5959}
6060
6161static bool http_key_lookup (scache_connection* connection, int n) {
@@ -141,47 +141,47 @@ static inline state_action http_read_requeststartmethod(scache_connection* conne
141141 assert (REQUEST_IS (connection->type , connection->type ));
142142 RBUF_READMOVE (connection->input , n + 1 );
143143 DEBUG (" [#%d] HTTP GET Request\n " , connection->client_sock );
144- return needs_more ;
144+ return needs_more_read ;
145145 }
146146 else if (n == 3 && rbuf_cmpn (&connection->input , " PUT" , 3 ) == 0 ) {
147147 // This is a PUT request
148148 connection->type = REQUEST_HTTPPUT ;
149149 assert (REQUEST_IS (connection->type , connection->type ));
150150 RBUF_READMOVE (connection->input , n + 1 );
151151 DEBUG (" [#%d] HTTP PUT Request\n " , connection->client_sock );
152- return needs_more ;
152+ return needs_more_read ;
153153 }
154154 else if (n == 4 && rbuf_cmpn (&connection->input , " HEAD" , 4 ) == 0 ) {
155155 // This is a HEAD request
156156 connection->type = REQUEST_HTTPHEAD ;
157157 assert (REQUEST_IS (connection->type , connection->type ));
158158 RBUF_READMOVE (connection->input , n + 1 );
159159 DEBUG (" [#%d] HTTP HEAD Request\n " , connection->client_sock );
160- return needs_more ;
160+ return needs_more_read ;
161161 }
162162 else if (n == 6 && rbuf_cmpn (&connection->input , " DELETE" , 6 ) == 0 ) {
163163 DEBUG (" [#%d] HTTP DELETE Request\n " , connection->client_sock );
164164 // This is a DELETE request
165165 connection->type = REQUEST_HTTPDELETE ;
166166 assert (REQUEST_IS (connection->type , connection->type ));
167167 RBUF_READMOVE (connection->input , n + 1 );
168- return needs_more ;
168+ return needs_more_read ;
169169 }
170170 else if ((n == 4 && rbuf_cmpn (&connection->input , " BULK" , 4 ) == 0 ) || (n == 5 && rbuf_cmpn (&connection->input , " PURGE" , 5 ) == 0 )) {
171171 // This is a BULK request
172172 connection->type = REQUEST_HTTPPURGE ;
173173 assert (REQUEST_IS (connection->type , connection->type ));
174174 RBUF_READMOVE (connection->input , n + 1 );
175175 DEBUG (" [#%d] HTTP BULK Request\n " , connection->client_sock );
176- return needs_more ;
176+ return needs_more_read ;
177177 }
178178 else if (n == 5 && rbuf_cmpn (&connection->input , " ADMIN" , 5 ) == 0 ) {
179179 // This is a BULK request
180180 connection->type = REQUEST_HTTPADMIN ;
181181 assert (REQUEST_IS (connection->type , connection->type ));
182182 RBUF_READMOVE (connection->input , n + 1 );
183183 DEBUG (" [#%d] HTTP ADMIN Request\n " , connection->client_sock );
184- return needs_more ;
184+ return needs_more_read ;
185185 }
186186
187187 // Else: This is an INVALID request
@@ -238,7 +238,7 @@ static inline state_action http_read_requeststarturl1(scache_connection* connect
238238 }
239239
240240 RBUF_READMOVE (connection->input , n);
241- return needs_more ;
241+ return needs_more_read ;
242242 }
243243 else if (*buffer == ' ' ) {
244244 if (REQUEST_IS (connection->type , REQUEST_HTTPGET ) || REQUEST_IS (connection->type , REQUEST_HTTPDELETE ) || REQUEST_IS (connection->type , REQUEST_HTTPPURGE )) {
@@ -262,7 +262,7 @@ static inline state_action http_read_requeststarturl1(scache_connection* connect
262262 // Else request for table/key
263263 CONNECTION_HANDLER (connection, http_cache_handle_headers);
264264 connection->state = 0 ;
265- return needs_more ;
265+ return needs_more_read ;
266266 }
267267
268268 if (REQUEST_IS (connection->type , REQUEST_HTTPADMIN )){
@@ -293,7 +293,7 @@ static state_action http_read_requeststarturl2(scache_connection* connection, ch
293293 RBUF_READMOVE (connection->input , n + 1 );
294294 connection->state = 0 ;
295295
296- return temporary ? needs_more : registered_write;
296+ return temporary ? needs_more_read : registered_write;
297297 }
298298
299299 return continue_processing;
@@ -313,14 +313,14 @@ static state_action http_read_headers(scache_connection* connection, char* buffe
313313 RBUF_READMOVE (connection->input , bytes + 1 );
314314 connection->state = HEADER_CONTENTLENGTH ;
315315 CONNECTION_HANDLER (connection, http_cache_handle_headers_extract);
316- return needs_more ;
316+ return needs_more_read ;
317317 }
318318 if (bytes == 5 && rbuf_cmpn (&connection->input , " X-Ttl" , 5 ) == 0 ) {
319319 DEBUG (" [#%d] Found X-Ttl header\n " , connection->client_sock );
320320 RBUF_READMOVE (connection->input , bytes + 1 );
321321 connection->state = HEADER_XTTL ;
322322 CONNECTION_HANDLER (connection, http_cache_handle_headers_extract);
323- return needs_more ;
323+ return needs_more_read ;
324324 }
325325 }
326326 else if (REQUEST_IS (connection->type , REQUEST_HTTPGET | REQUEST_CACHE_LEVELTABLE )) {
@@ -329,14 +329,14 @@ static state_action http_read_headers(scache_connection* connection, char* buffe
329329 RBUF_READMOVE (connection->input , bytes + 1 );
330330 connection->state = HEADER_XSTART ;
331331 CONNECTION_HANDLER (connection, http_cache_handle_headers_extract);
332- return needs_more ;
332+ return needs_more_read ;
333333 }
334334 if (bytes == 7 && rbuf_cmpn (&connection->input , " X-Limit" , 7 ) == 0 ) {
335335 DEBUG (" [#%d] Found X-Limit header\n " , connection->client_sock );
336336 RBUF_READMOVE (connection->input , bytes + 1 );
337337 connection->state = HEADER_XLIMIT ;
338338 CONNECTION_HANDLER (connection, http_cache_handle_headers_extract);
339- return needs_more ;
339+ return needs_more_read ;
340340 }
341341 }
342342 else if (REQUEST_IS (connection->type , REQUEST_HTTPPURGE | REQUEST_CACHE_LEVELTABLE )) {
@@ -345,7 +345,7 @@ static state_action http_read_headers(scache_connection* connection, char* buffe
345345 RBUF_READMOVE (connection->input , bytes + 1 );
346346 connection->state = HEADER_XDELETE ;
347347 CONNECTION_HANDLER (connection, http_cache_handle_headers_extract);
348- return needs_more ;
348+ return needs_more_read ;
349349 }
350350 }
351351 }
@@ -364,7 +364,7 @@ static state_action http_read_headers(scache_connection* connection, char* buffe
364364 }
365365
366366 CONNECTION_HANDLER (connection, http_cache_handle_request_body);
367- return needs_more ;
367+ return needs_more_read ;
368368 }
369369 if (connection->cache .target .key .entry != NULL ) {
370370 if (REQUEST_IS (connection->type , REQUEST_HTTPGET ) || REQUEST_IS (connection->type , REQUEST_HTTPHEAD )) {
@@ -419,7 +419,7 @@ static state_action http_read_headers(scache_connection* connection, char* buffe
419419
420420 // Move pointers to next record
421421 RBUF_READMOVE (connection->input , n + 1 );
422- return needs_more ;
422+ return needs_more_read ;
423423 }
424424 else if (*buffer != ' \r ' ) {
425425 temporary = 0 ;
@@ -558,7 +558,7 @@ static state_action http_read_header_extraction(scache_connection* connection, c
558558 connection->state = 1 ;
559559 CONNECTION_HANDLER (connection, http_cache_handle_headers);
560560 RBUF_READMOVE (connection->input , length + temporary);
561- return needs_more ;
561+ return needs_more_read ;
562562 }
563563 else {
564564 temporary = 1 ;
@@ -575,7 +575,7 @@ static state_action http_read_version(scache_connection* connection, char* buffe
575575
576576 RBUF_READMOVE (connection->input , n + 1 );
577577 n = -1 ;
578- return needs_more ;
578+ return needs_more_read ;
579579 }
580580 return continue_processing;
581581}
@@ -632,7 +632,7 @@ state_action http_cache_handle_eolstats(scache_connection* connection) {
632632 DEBUG (" [#%d] Handling HTTP EOL Search, then writing stats\n " , connection->client_sock );
633633
634634 RBUF_ITERATE (connection->input , n, buffer, end, ret, http_read_eoltoend (connection, buffer, n, connection->state ));
635- if (n != 0 && ret == needs_more ) {
635+ if (n != 0 && ret == needs_more_read ) {
636636 RBUF_READMOVE (connection->input , n);
637637 }
638638 if (ret == registered_write) {
0 commit comments