Skip to content

Can't login if you're offline #489

Closed
CapnKernel opened this Issue Feb 12, 2014 · 1 comment

2 participants

@CapnKernel

Hi,

Sorry if this issue is already reported. My Chinese is not good enough to read all the bug reports.

When I try to log in, I get the message "Invalid pointer".

liblwqq/lib/login.c has this source:

void lwqq_login(LwqqClient *client, LwqqStatus status,LwqqErrorCode *err)
{
if (!client || !status) {
lwqq_log(LOG_ERROR, "Invalid pointer\n");

If status is not zero, then you can't log in.

liblwqq/lib/type.h defines LwqqStatus:

typedef enum {
LWQQ_STATUS_LOGOUT = 0,
LWQQ_STATUS_ONLINE = 10,
LWQQ_STATUS_OFFLINE = 20,
...
}LwqqStatus;

If status is LWQQ_STATUS_LOGOUT, then you can log in. But if status is LWQQ_STATUS_OFFLINE, you cannot.

I changed login.c like this:

diff --git a/lib/login.c b/lib/login.c
index 1eb5872..a3f207c 100644
--- a/lib/login.c
+++ b/lib/login.c
@@ -557,7 +557,7 @@ done:
*/
void lwqq_login(LwqqClient *client, LwqqStatus status,LwqqErrorCode *err)
{

  • if (!client || !status) {
  • if (!client || !(status == LWQQ_STATUS_LOGOUT || status == LWQQ_STATUS_OFFLINE)) { lwqq_log(LOG_ERROR, "Invalid pointer\n"); return ; }

Now I can log in again.

@xiehuc
Owner
xiehuc commented Feb 12, 2014

it's ture that code logic has some problem.

but i'm wonder, why you assignment status as LWQQ_STATUS_OFFLINE.

the status variable in lwqq_login mean's you want to login as what state, busy?away?hidden?

but you login as offline status that's strange, because offline means not online.

@xiehuc xiehuc closed this Apr 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.