Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL occasional incorrect header check

Discussion in 'WebGL' started by markachten88, Nov 13, 2017.

  1. markachten88

    markachten88

    Joined:
    Apr 24, 2015
    Posts:
    31
    He guys.

    We have our webgl game hosted on IIS with configuration as set below:

    <remove fileExtension=".mem" />
    <mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
    <remove fileExtension=".data" />
    <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    <remove fileExtension=".memgz" />
    <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
    <remove fileExtension=".datagz" />
    <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
    <remove fileExtension=".unity3dgz" />
    <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
    <remove fileExtension=".jsgz" />
    <mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />

    Seems ok, right? But once in a while we get an "incorrect header check" error. I included the code above cause most related forum posts point to config.

    Looking at where in the unityloader.js file the error is shown give me this:

    if (n.flags = 0, n.head && (n.head.done = !1), !(1 & n.wrap) || (((255 & f) << 8) + (f >> 8)) % 31) {
    e.msg = "incorrect header check",
    n.mode = ce;
    break
    }

    Now, I can't make heads or tails out of this but maybe someone else can. Who can explain me the 'if' statement here? Thanks in advance...
     
  2. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    My reading of that suggests either n.wrap is an odd number or your failing the checksum like test of f (that the shifted bits aren't evenly divisible by 31)
     
  3. markachten88

    markachten88

    Joined:
    Apr 24, 2015
    Posts:
    31
    Ok, thanks for that. Any thoughts on what that means? I can think of checksums in way that downloading the content could have been interrupted or something like that. But what about the n.wrap thing?
    Already tweeted #emscripten to see if someone could give me some insights as well. Thanks!
     
  4. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    I don't use the target, the excerpt you've shared is obviously not enough to make any guesses about why n.wrap has to be positive/divisible by 2.