| 59 | | } |
|---|
| 60 | | |
|---|
| 61 | | /* evil hack for opera 9.01 and 8.54 and earlier |
|---|
| 62 | | * |
|---|
| 63 | | * opera hangs if the trainling 0\r\n\r\n is in a seperate SSL-packet |
|---|
| 64 | | * |
|---|
| 65 | | * we try to move the packet into the previous mem-chunk if possible |
|---|
| 66 | | */ |
|---|
| 67 | | if ((cq == con->write_queue) && |
|---|
| 68 | | (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) && |
|---|
| 69 | | (con->file_finished)) { |
|---|
| 70 | | /* merge the last chunk into the previous chunk */ |
|---|
| 71 | | |
|---|
| 72 | | for(c = cq->first; c && c->next && c->next->next; c = c->next); |
|---|
| 73 | | |
|---|
| 74 | | if (c && |
|---|
| 75 | | c->type == MEM_CHUNK && |
|---|
| 76 | | c->next && |
|---|
| 77 | | c->next->type == MEM_CHUNK && |
|---|
| 78 | | c->next->mem->used == sizeof("0\r\n\r\n") && |
|---|
| 79 | | 0 == strcmp(c->next->mem->ptr, "0\r\n\r\n")) { |
|---|
| 80 | | buffer_append_string_buffer(c->mem, c->next->mem); |
|---|
| 81 | | |
|---|
| 82 | | c->next->mem->used = 0; |
|---|
| 83 | | } |
|---|