GithubHelp home page GithubHelp logo

Unable to Read Post Data about cef.swift HOT 4 CLOSED

lvsti avatar lvsti commented on June 14, 2024
Unable to Read Post Data

from cef.swift.

Comments (4)

Docgeo avatar Docgeo commented on June 14, 2024

Found the solution :)

In CEFPostData.swift - row 40 :

/// Retrieve the post data elements.
    /// CEF name: `GetElements`
    public var elements: [CEFPOSTDataElement] {
        var count: size_t = 0
        var cefElements: UnsafeMutablePointer<cef_post_data_element_t>? = nil
        
        cefObject.get_elements(cefObjectPtr, &count, &cefElements)

As the count value is used in the method get_elements, it will always have 0 elements.The correction is simple (use the property elementCount, which have the good value) :

var count: size_t = elementCount

Thus the post data can be read without problem :)

I let you commit the correction, it will be easier.

from cef.swift.

lvsti avatar lvsti commented on June 14, 2024

Thanks for surfacing this. The solution was actually a bit more involved as it turned out that get_elements wouldn't allocate any memory, so I had to fully construct cefElements. Pushing fix soon.

from cef.swift.

lvsti avatar lvsti commented on June 14, 2024

Pls verify if it works for you as well

from cef.swift.

Docgeo avatar Docgeo commented on June 14, 2024

Hi,

Yes it works with your correction.
Without allocating memory, it was also working, but it was maybe luck.

So, I use now your correction, thanks.

from cef.swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.