Browse Source

[mod_magnet] use http_chunk_* APIs

use http_chunk_* APIs in magnet_attach_content() for consistency
(and sending output to tempfiles if large)
master
Glenn Strauss 9 months ago
parent
commit
4db5c1ec7b
  1. 3
      src/mod_magnet.c

3
src/mod_magnet.c

@ -762,8 +762,7 @@ static int magnet_attach_content(request_st * const r, lua_State * const L, int
/* -1 is the value and should be the value ... aka a table */
if (lua_isstring(L, -1)) {
const_buffer data = magnet_checkconstbuffer(L, -1);
chunkqueue_append_mem(&r->write_queue, data.ptr, data.len);
http_chunk_append_mem(r, data.ptr, data.len);
} else if (lua_istable(L, -1)) {
lua_getfield(L, -1, "filename");
lua_getfield(L, -2, "length"); /* (0-based) end of range (not actually "length") */

Loading…
Cancel
Save