@@ -202,9 +202,9 @@ static inline state_action http_read_requeststartmethod(int epfd, cache_connecti
202202 RBUF_READMOVE (connection->input , n + 1 );
203203 return needs_more;
204204 }
205- else if (n == 4 && rbuf_cmpn (&connection->input , " BULK" , 4 ) == 0 ) {
205+ else if (n == 4 && ( rbuf_cmpn (&connection->input , " BULK" , 4 ) == 0 || rbuf_cmpn (&connection-> input , " PURGE " , 5 ) == 0 ) ) {
206206 // This is a BULK request
207- connection->type = REQUEST_HTTPBULK ;
207+ connection->type = REQUEST_HTTPPURGE ;
208208 assert (REQUEST_IS (connection->type , connection->type ));
209209 RBUF_READMOVE (connection->input , n + 1 );
210210 DEBUG (" [#%d] HTTP BULK Request\n " , connection->client_sock );
@@ -276,7 +276,7 @@ static inline state_action http_read_requeststarturl1(int epfd, cache_connection
276276 return needs_more;
277277 }
278278 else if (*buffer == ' ' ) {
279- if (REQUEST_IS (connection->type , REQUEST_HTTPGET) || REQUEST_IS (connection->type , REQUEST_HTTPDELETE) || REQUEST_IS (connection->type , REQUEST_HTTPBULK )) {
279+ if (REQUEST_IS (connection->type , REQUEST_HTTPGET) || REQUEST_IS (connection->type , REQUEST_HTTPDELETE) || REQUEST_IS (connection->type , REQUEST_HTTPPURGE )) {
280280 // Request for "/"
281281 if (n == 1 ) {
282282 // Stats Command
@@ -374,7 +374,7 @@ static state_action http_read_headers(int epfd, cache_connection* connection, ch
374374 return needs_more;
375375 }
376376 }
377- else if (REQUEST_IS (connection->type , REQUEST_HTTPBULK | REQUEST_LEVELTABLE)) {
377+ else if (REQUEST_IS (connection->type , REQUEST_HTTPPURGE | REQUEST_LEVELTABLE)) {
378378 if (bytes == 8 && rbuf_cmpn (&connection->input , " X-Delete" , 8 ) == 0 ) {
379379 DEBUG (" [#%d] Found X-Delete header\n " , connection->client_sock );
380380 RBUF_READMOVE (connection->input , bytes + 1 );
@@ -441,7 +441,7 @@ static state_action http_read_headers(int epfd, cache_connection* connection, ch
441441 db_table_handle_delete (connection->target .table .table );
442442 return http_write_response (epfd, connection, HTTPTEMPLATE_FULLHTTP200DELETED);
443443 }
444- if (REQUEST_IS (connection->type , REQUEST_HTTPBULK )) {
444+ if (REQUEST_IS (connection->type , REQUEST_HTTPPURGE )) {
445445 return http_write_response (epfd, connection, HTTPTEMPLATE_BULK_OK);
446446 }
447447 if (REQUEST_IS (connection->type , REQUEST_HTTPADMIN)) {
@@ -573,7 +573,7 @@ static state_action http_read_header_extraction(int epfd, cache_connection* conn
573573 break ;
574574
575575 case HEADER_XDELETE:
576- if (REQUEST_IS (connection->type , REQUEST_HTTPBULK | REQUEST_LEVELTABLE) && connection->target .table .table != NULL ) {
576+ if (REQUEST_IS (connection->type , REQUEST_HTTPPURGE | REQUEST_LEVELTABLE) && connection->target .table .table != NULL ) {
577577 char * key = (char *)malloc (length);
578578 rbuf_copyn (&connection->input , key, length);
579579 cache_entry* entry = db_entry_get_delete (connection->target .table .table , key, length);
0 commit comments