mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 22:45:12 +00:00
[ADD] Respect MIME, start bridging leaves/kicks
Wow, this one _wasn't_ pushed at 3AM, Outstanding.
This commit is contained in:
parent
4d055f3688
commit
43b3f8aaf5
8 changed files with 146 additions and 24 deletions
9
src/AS.c
9
src/AS.c
|
|
@ -632,7 +632,7 @@ ASSetPL(const ParseeConfig *conf, char *id, HashMap *m)
|
|||
}
|
||||
|
||||
char *
|
||||
ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
|
||||
ASUpload(const ParseeConfig *c, Stream *from, unsigned int size, char *mime)
|
||||
{
|
||||
char *size_str, *path, *ret, *user;
|
||||
int i;
|
||||
|
|
@ -640,7 +640,6 @@ ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
|
|||
HashMap *reply;
|
||||
if (!c || !from)
|
||||
{
|
||||
Log(LOG_INFO, "Obvious upload fail");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -655,6 +654,10 @@ ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
|
|||
{
|
||||
HttpRequestHeader(ctx, "Content-Length", size_str);
|
||||
}
|
||||
if (mime)
|
||||
{
|
||||
HttpRequestHeader(ctx, "Content-Type", mime);
|
||||
}
|
||||
HttpRequestSendHeaders(ctx);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
|
|
@ -739,7 +742,7 @@ ASReupload(const ParseeConfig *c, char *from, char **mime)
|
|||
{
|
||||
size = strtol(content_len, NULL, 10);
|
||||
}
|
||||
ret = ASUpload(c, HttpClientStream(ctx), size);
|
||||
ret = ASUpload(c, HttpClientStream(ctx), size, mime ? *mime : NULL);
|
||||
|
||||
HttpClientContextFree(ctx);
|
||||
UriFree(uri);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue