prnt/hpcups/Encapsulator.cpp send 10000 bytes of 0x00 to the printer before the real PCL commands

Bug #1648954 reported by Benjamin Woods
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
Fix Committed
Undecided
Unassigned

Bug Description

This bug was originally reported on the FreeBSD bug tracker by Matthias Apitz:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207738

While hunting some other problem with a HP Deskjet 2510 printer, I discovered that prnt/hpcups/Encapsulator.cpp send 10000 bytes of 0x00 to the printer before the real PCL commands.

Is this required / necessary?

prnt/hpcups/CommonDefinitions.h:

#define PCL_BUFFER_SIZE 10000

prnt/hpcups/Encapsulator.cpp:

    cur_pcl_buffer_size = PCL_BUFFER_SIZE;
    pcl_buffer = new BYTE[cur_pcl_buffer_size + 2];
    if (pcl_buffer == NULL) {
        return ALLOCMEM_ERROR;
    }
    memset(pcl_buffer, 0, cur_pcl_buffer_size);
    cur_pcl_buffer_ptr = pcl_buffer;

    err = flushPrinterBuffer();

prnt/hpcups/Encapsulator.h:

    virtual DRIVER_ERROR flushPrinterBuffer()
    {
        return m_pSystemServices->Send((const BYTE *) pcl_buffer, 10000);
    }

$ od -c printer24674.prn | head -5
0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0023420 033 E 033 % - 1 2 3 4 5 X @ P J L
0023440 S E T S T R I N G C O D E S E
0023460 T = U T F 8 \n @ P J L C O M M
...

Changed in hplip:
status: New → In Progress
Changed in hplip:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.