[Pkg-wmaker-commits] [wmcoincoin] 02/87: Ne pas afficher d'erreur pour tous les codes http < 400 et éviter de mettre des \n en trop dans les headers
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Aug 28 17:27:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmcoincoin.
commit cb186984e711efdb8f9db29ede914ced4cfc53b4
Author: SeeSchloss <mvalleton at noparking.net>
Date: Fri May 30 17:09:44 2014 +0200
Ne pas afficher d'erreur pour tous les codes http < 400 et éviter de mettre des \n en trop dans les headers
---
src/wmcoincoin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/wmcoincoin.c b/src/wmcoincoin.c
index 429210d..df27580 100644
--- a/src/wmcoincoin.c
+++ b/src/wmcoincoin.c
@@ -718,8 +718,10 @@ exec_coin_coin(Dock *dock, int sid, const char *ua, const char *msg_)
/* Triton> Euh..., je ne suis pas sur de ce que je dois mettre ici,
je crois que je vais repousser � plus tard.
Bon, tonton zorel< a dit text/xml alors je mets text/xml
- hop, un truc de plus qui est fait ! Patch Accept: fini. \o/ */
- r.accept = strdup("text/xml");
+ hop, un truc de plus qui est fait ! Patch Accept: fini. \o/
+ See> application/xml, c'est bien aussi.
+ */
+ r.accept = strdup("application/xml, text/xml");
if (dock->post_anonyme && r.cookie) { free(r.cookie); r.cookie = NULL; }
r.type = HTTP_POST;
r.referer = strdup(path); url_au_coiffeur(r.referer, 1);
@@ -752,12 +754,16 @@ exec_coin_coin(Dock *dock, int sid, const char *ua, const char *msg_)
}
if (!site->prefs->user_cookie && r.new_cookie) {
site->prefs->user_cookie = strdup(r.new_cookie);
+ char *p;
+ for (p = site->prefs->user_cookie; *p; ++p) {
+ if (*p == '\n' || *p == '\r') *p = ' ';
+ }
}
http_request_close(&r);
site->http_success_cnt++;
site->http_recent_error_cnt = 0;
site->board->last_posted_id = r.post_id;
- } else if (r.response != 302 && r.response != 406) {
+ } else if (r.response >= 400 && r.response != 406) { /* 406 c'est du b�te "Not Acceptable", on s'en fout */
char *s;
/* si la reponse n'est pas un 302 Found */
s = str_printf(_("[%s] Damned ! There has been an error<p>%s"), site->prefs->site_name, http_error());
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcoincoin.git
More information about the Pkg-wmaker-commits
mailing list