mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 13:45:10 +00:00
[MOD/FIX] Be a bit more specific with component errors
This commit is contained in:
parent
389870c5d3
commit
f9de7f1750
3 changed files with 11 additions and 14 deletions
|
|
@ -26,20 +26,15 @@ JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name, char
|
|||
char *rev = StrConcat(3, muc, "/", nick);
|
||||
int nonce = 0;
|
||||
|
||||
Log(LOG_DEBUG, "MUCJOINER: filtered '%s' to '%s'", name, nick);
|
||||
|
||||
UnistrFree(uninick);
|
||||
UnistrFree(filtered);
|
||||
UnistrFree(filterASCII);
|
||||
|
||||
/* TODO: Make sure that we fall back to plain ASCII if it fails too many
|
||||
* times. */
|
||||
/* TODO: vCards! */
|
||||
while (!XMPPJoinMUC(data->jabber, jid, rev, hash, -1, true) && nonce < 32)
|
||||
{
|
||||
char *nonce_str = StrInt(nonce);
|
||||
char *input = StrConcat(3, sender, name, nonce_str);
|
||||
char *hex = ParseeHMACS(data->id, input);
|
||||
Unistr *filterASCII = UnistrFilter(uninick, UnistrIsASCII);
|
||||
|
||||
if (strlen(hex) >= 8)
|
||||
{
|
||||
|
|
@ -48,7 +43,6 @@ JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name, char
|
|||
|
||||
Free(nick);
|
||||
Free(rev);
|
||||
Free(revscii);
|
||||
|
||||
nick = StrConcat(4, name, "[", hex, "]");
|
||||
rev = StrConcat(3, muc, "/", nick);
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@ SignalHandler(int signal)
|
|||
HttpServerStop(data->server);
|
||||
return;
|
||||
}
|
||||
if (signal == SIGPIPE)
|
||||
{
|
||||
Log(LOG_DEBUG, "Caught a SIGPIPE...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -46,7 +41,7 @@ ParseeInitialiseSignals(ParseeData *d, pthread_t xmpp)
|
|||
sa.sa_flags = SA_RESTART;
|
||||
|
||||
#define Register(act) (sigaction(act, &sa, NULL) >= 0)
|
||||
if (!Register(SIGTERM) || !Register(SIGINT) || !Register(SIGPIPE))
|
||||
if (!Register(SIGTERM) || !Register(SIGINT))
|
||||
{
|
||||
Log(LOG_ERR, "Couldn't register signals...");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ XMPPInitialiseCompStream(char *addr, char *host, int port)
|
|||
|
||||
if (connect(sd, res->ai_addr, res->ai_addrlen) < 0)
|
||||
{
|
||||
Log(LOG_ERR,
|
||||
"%s: cannot connect to '%s': %s", __func__,
|
||||
host, strerror(errno)
|
||||
);
|
||||
close(sd);
|
||||
sd = -1;
|
||||
continue;
|
||||
|
|
@ -82,6 +86,10 @@ XMPPInitialiseCompStream(char *addr, char *host, int port)
|
|||
stream = StreamFd(sd);
|
||||
if (!stream)
|
||||
{
|
||||
Log(LOG_ERR,
|
||||
"%s: cannot connect to '%s': %s", __func__,
|
||||
host, "couldn't create a Cytoplasm stream"
|
||||
);
|
||||
close(sd);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue