×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    16

    gzread -2 error with Qt for symbian

    Hi
    I am trying to develop an application that reads a gziped http response from a http server, uncompress it and interpret the data. I am working on Symbian 5th edition SDK with Qt version 4.6.2.

    I have a gzip compressed data in a QByteArray. I am using gzread() method of zlib library to uncompress it.
    But gzread() is returing the number of bytes read as -2. When i call gzerror() with the same bytearray to get the error code, i am getting a user 42 panic. Can anyone help me in this?

    Below in my code snippet

    // response is a QByteArray that has a gzip compressed data.
    // byteSize is an unsigned integer that has the size of the uncompressed data
    QByteArray uncompressedData;

    int readBytes = gzread(response.data(), uncompressedData.data(), byteSize);
    if(readBytes <= 0)
    {
    int errnum;
    gzerror(&response, &errnum);
    }

    Thanks & Regards
    NishaElsa

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: gzread -2 error with Qt for symbian

    http://refspecs.freestandards.org/LS...gzerror-1.html
    gzerror is accepting gzFile as first argument, why do you pass QByteArray* there?
    The same thing with gzread.
    http://refspecs.freestandards.org/LS...-gzread-1.html

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    16

    Re: gzread -2 error with Qt for symbian

    gzfile is a void* right? as the data to be compressed is not a file but a buffer, is there any other way that i can pas it to gzread?

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: gzread -2 error with Qt for symbian

    Quote Originally Posted by NishaElsa View Post
    gzfile is a void* right?
    It's opaque gzip file descriptor you obtain from gzopen.
    Quote Originally Posted by NishaElsa View Post
    as the data to be compressed is not a file but a buffer, is there any other way that i can pas it to gzread?
    Even name tells you it's a file descriptor not a buffer.
    In this thread you have got a reply how to proceed (I mean the last comment)
    http://discussion.forum.nokia.com/fo...d.php?t=200477
    Last edited by divanov; 2010-05-13 at 10:20. Reason: clarifying

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. automatic rotate screen on meamo
    By fily_love in forum Nokia N9
    Replies: 27
    Last Post: 2010-04-06, 08:37
  3. gsreamer-0.10-plugins-good+Phonon
    By niqt in forum Nokia N9
    Replies: 10
    Last Post: 2010-03-05, 09:56
  4. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41
  5. Senior QT Client Developer (Dublin, Ireland)
    By marynyc in forum News and Announcements
    Replies: 0
    Last Post: 2009-06-02, 18:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •